package cn.changeforyou.demo.netty.common;

/**
 * @author zhyu
 * @date 2021/3/16 12:57
 */
public class Res {

    private int code;
    private String message;
    private Object data;
    private String msgId;

    private Res() {
    }

    public Res(int code, String message, Object data, String msgId) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.msgId = msgId;
    }

    public static Res success(Object object, String msgId) {
        return new Res(0, "ok", object, msgId);
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }

    public String getMsgId() {
        return msgId;
    }
}
